const env = require("../../env")
export default ({ $axios }, inject) => {
  const _API = {
    // bannerList: (params = {}) => $axios.get(`support/banner/1.0/list-banner`, { params }), //首页轮播
    equipmentList: (params = {}) => $axios.post(`client/1.0/onLine/allEquipmentList`, params), //设备列表
    machineType: (params = {}) => $axios.get(`operate/equipment/type/v1/get-all`, { params }), //设备机型
    machineBrand: (params = {}) => $axios.get(`operate/equipment/brand/v1/list-by-type-id`, { params }), //设备品牌
    machineModel: (params = {}) => $axios.get(`operate/equipment/model/v1/list-by-brand-id`, { params }), //获取设备型号
    addClue: (params = {}) => $axios.post(`client/1.0/overseas/clue/add`, params), //提交线索
    searchConfig: (params = {}) => $axios.get(`support/template/1.0/get-equipment-search-config`, { params }), //筛选-模板
    equipmentDetail: (params = {}) => $axios.get(`dealer/1.0/crmEquipment/get`, { params }), //设备详情
    equipmentRecommend: (params = {}) => $axios.get(`client/1.0/equipment-recommend`, { params }), //设备推荐
    // getPosterInfo: (params = {}) => $axios.get(`operate/equipment/manage-poster-info`, { params }), //主要用来判断是竞拍还是询价，因为小程序需要使用不同的路径
    // getVxCode: (params = {}) => $axios.get(`passport/wx/v1/get-wx-img-url`, { params }), //获取菊花码
    burySave: (params = {}) => $axios.get(`${env[process.env.NODE_ENV].InBase_Url}mp/bury/1.0/bury/save`, { params }), //埋点接口
    articleList: (params = {}) => $axios.post(`${env[process.env.NODE_ENV].InBase_Url}mp/article/1.0/article-content/list`, params), //文章列表
    articleDetail: (params = {}) => $axios.get(`${env[process.env.NODE_ENV].InBase_Url}mp/article/1.0/article-content/details`, { params }), //文章详情
    articleShare: (params = {}) =>
      $axios.get(`${env[process.env.NODE_ENV].InBase_Url}mp/article/1.0/article-content/increase-share-count`, { params }), //文章转发
    webSocketUrl: `${env[process.env.NODE_ENV].webSocket_Url}mp/talk/web-socket`, //webSocket连接
    sendMsgUrl: (params = {}) => $axios.post(`${env[process.env.NODE_ENV].InBase_Url}mp/talk/1.0/tourist-send-talk-msg`, params), //发送消息
    listMsgUrl: (params = {}) => $axios.post(`${env[process.env.NODE_ENV].InBase_Url}mp/talk/1.0/list-talk-msg`, params), //消息列表
    allCategory: (params = {}) => $axios.get(`${env[process.env.NODE_ENV].InBase_Url}mp/web-crawling/1.0/sany-global/product/all-category`, { params }), //产品库所有分类列表
    allCategoryGroup: (params = {}) => $axios.get(`${env[process.env.NODE_ENV].InBase_Url}mp/web-crawling/1.0/sany-global/product/all-category-group`, { params }), //产品库大分类
    categoryList: (params = {}) => $axios.get(`${env[process.env.NODE_ENV].InBase_Url}mp/web-crawling/1.0/sany-global/product/category-list`, { params }), //产品库二级分类
    categoryDetails: (params = {}) => $axios.get(`${env[process.env.NODE_ENV].InBase_Url}mp/web-crawling/1.0/sany-global/product/category-details`, { params }), //产品库分类详情
    skuDetails: (params = {}) => $axios.get(`${env[process.env.NODE_ENV].InBase_Url}mp/web-crawling/1.0/sany-global/product/sku-details`, { params }) //产品库sku详情
  }
  //注入到全局nuxt示例中
  inject("api", _API)
}
